{% extends 'base.html' %}

{% block breadcrumb_current %}
    超级管理员 > 新增地市
{% endblock %}

{% block content %}

    {% if messages %}
        {% for message in messages %}
            <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
                {{ message }}
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        {% endfor %}
    {% endif %}
    
    <div class="bg-light p-3 shadow-sm">
        <h5 style="color: #417690;">
            新增地市
            <a href="{% url 'supercompany_list' %}" class="btn btn-secondary btn-sm float-end" style="margin-left: 15px;">返回地市列表</a></h5>
    </div>


<div class="container mt-4">
    <div class="card" style="margin-top: 50px;">
        <div class="card-body">

            <form method="post" novalidate>
                {% csrf_token %}
                <div class="row"> 
                <div class="form-section">
                    <div class="row">
                        <div class="col-md-2 mb-3 mx-auto" style="margin-top: 30px;">
                            <label for="{{ form.company.id_for_label }}" class="form-label required">地市名称</label>
                            <input type="text" name="{{ form.company.name }}" id="{{ form.company.id_for_label }}" 
                                class="form-control {% if form.company.errors %}is-invalid{% endif %}" 
                                value="{{ form.company.value|default:'' }}">
                            {% if form.company.errors %}
                                <div class="invalid-feedback">{{ form.company.errors|join:", " }}</div>
                            {% endif %}
                        </div>
                    </div>
                </div>
                
                    <div class="text-center"  style="margin-top: 30px;">
                        <button type="submit" class="btn ms-2" style="background-color: #417690; color: white;">保 存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}
